package lumingweihua.future.cn.lumingweihua.home.domain;

import android.text.TextUtils;

import java.io.Serializable;
import java.util.List;

/**
 * Created by Administrator on 2018/3/3.
 */

public class HuoyuanDetailData implements Serializable{
    private String good_num;//货单号
    private String loading;//装货起点
    private String loading_address;//装货起点详细地址
    private List<UnloadData> xiehuo;
    private String mileage;//预计历程
    private String use_time;//用车时间
    private String type;//货物名称
    private String weight;//货物重量
    private String good_price;//运输单价
    private String cost;//运输费
    private String account_type;//结算方式
    private String remark;//货主备注
    private String indent_type;//1已发出抢单 2未发出
    private String user_type;//1自己发布的
    private String surplus_weight;//剩余可抢吨数
    private String good_status;//1待审核 2已通过 3拒绝 4结束;
    private String reason;//拒绝原因
    private String lat;
    private String lon;
    private String typeid;
    private String hot_line;

    public List<UnloadData> getXiehuo() {
        return xiehuo;
    }

    public void setXiehuo(List<UnloadData> xiehuo) {
        this.xiehuo = xiehuo;
    }

    public String getUnit_price() {
        return good_price;
    }

    public void setUnit_price(String unit_price) {
        this.good_price = unit_price;
    }


    public boolean getIsself() {
        return "1".equals(user_type);
    }

    public void setIsself(String isself) {
        this.user_type = isself;
    }

    public String getGood_num() {
        return good_num;
    }

    public void setGood_num(String good_num) {
        this.good_num = good_num;
    }

    public String getLoading() {
        return loading;
    }

    public void setLoading(String loading) {
        this.loading = loading;
    }

    public String getLoading_address() {
        return loading_address;
    }

    public void setLoading_address(String loading_address) {
        this.loading_address = loading_address;
    }

    public String getMileage() {
        return TextUtils.isEmpty(mileage)?"0":mileage;
    }

    public void setMileage(String mileage) {
        this.mileage = mileage;
    }

    public String getUse_time() {
        return use_time;
    }

    public void setUse_time(String use_time) {
        this.use_time = use_time;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public String getCost() {
        return cost;
    }

    public void setCost(String cost) {
        this.cost = cost;
    }

    public String getAccount_type() {
        return account_type;
    }

    public void setAccount_type(String account_type) {
        this.account_type = account_type;
    }

    public String getNote() {
        return remark;
    }

    public void setNote(String note) {
        this.remark = note;
    }

    public String getIndent_type() {
        return indent_type;
    }

    public void setIndent_type(String indent_type) {
        this.indent_type = indent_type;
    }

    public String getSurplus_weight() {
        return surplus_weight;
    }

    public void setSurplus_weight(String surplus_weight) {
        this.surplus_weight = surplus_weight;
    }
    public float getRemain_weight() {
        float w = 0;
        try {
            w = Float.valueOf(surplus_weight);
        } catch (Exception e) {
            // TODO: handle exception
        }
        return w;
    }

    public String getGood_status() {
        return good_status;
    }

    public void setGood_status(String good_status) {
        this.good_status = good_status;
    }

    public String getReject_reason() {
        return reason==null?"未填写":reason;
    }

    public void setReject_reason(String reject_reason) {
        this.reason = reject_reason;
    }
    public double getLat() {
        double l = 0;
        try {
            l = Double.valueOf(lat);
        } catch (Exception e) {
            // TODO: handle exception
        }
        return l==0?30.26:l;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    public double getLon() {
        double l = 0;
        try {
            l = Double.valueOf(lon);
        } catch (Exception e) {
            // TODO: handle exception
        }
        return l==0?120.19:l;
    }

    public void setLon(String lon) {
        this.lon = lon;
    }

    public String getTypeid() {
        return typeid;
    }

    public void setTypeid(String typeid) {
        this.typeid = typeid;
    }

    public String getHot_line() {
        return hot_line;
    }

    public void setHot_line(String hot_line) {
        this.hot_line = hot_line;
    }
}
